package com.add.petback.service.impl;

import com.add.petback.dao.CommentMapper;
import com.add.petback.model.Comment;
import com.add.petback.service.CommentService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * (Comment)表服务实现类
 *
 * @author makejava
 * @since 2020-03-10 15:54:08
 */
@Service("commentService")
public class CommentServiceImpl implements CommentService {

    @Resource
    private CommentMapper mapper;

    @Override
    public void insert(Comment object) {
        mapper.insertSelective(object);
    }

    @Override
    public void save(Comment object) {
        mapper.updateByPrimaryKeySelective(object);
    }

    @Override
    public List<Comment> getAll() {
        return mapper.list(new Comment());
    }

    @Override
    public Comment find(Comment object) {
        return mapper.find(object);
    }

    @Override
    public void delete(Comment object) {
        mapper.deleteByPrimaryKey(object.getCommentpk());
    }

    @Override
    public List<Comment> getList(Comment object) {
        return mapper.list(object);
    }

}